﻿using NUnit.Framework;

namespace Drill.Configuration
{
	[TestFixture]
	public class SearchPathConfigurationTests
	{
		[Test]
		public void CanConstruct()
		{
			// Arrange
			// Nothing to arrange.

			// Act
			var itemUnderTest = new SearchPathConfiguration();

			// Assert
			Assert.That(itemUnderTest, Is.Not.Null);
		}

		[Test]
		public void EnabledPropertyIsFalseAfterDefaultConstruction()
		{
			// Arrange
			// Nothing to arrange.

			// Act
			var itemUnderTest = new SearchPathConfiguration();

			// Assert
			Assert.That(itemUnderTest.Enabled, Is.False);
		}

		[Test]
		public void PathPropertyIsNullAfterDefaultConstruction()
		{
			// Arrange
			// Nothing to arrange.

			// Act
			var itemUnderTest = new SearchPathConfiguration();

			// Assert
			Assert.That(itemUnderTest.Path, Is.Null);
		}

		[Test]
		public void CanSetEnabledPropertyToFalse()
		{
			// Arrange
			var itemUnderTest = new SearchPathConfiguration();

			// Act
			itemUnderTest.Enabled = false;

			// Assert
			Assert.That(itemUnderTest.Enabled, Is.False);
		}

		[Test]
		public void CanSetEnabledPropertyToTrue()
		{
			// Arrange
			var itemUnderTest = new SearchPathConfiguration();

			// Act
			itemUnderTest.Enabled = true;

			// Assert
			Assert.That(itemUnderTest.Enabled, Is.True);
		}

		[Test]
		public void CanSetPathProperty()
		{
			// Arrange
			const string expectedValue = @"Dir01\Dir02\Dir03";
			var itemUnderTest = new SearchPathConfiguration();

			// Act
			itemUnderTest.Path = @"Dir01\Dir02\Dir03";

			// Assert
			Assert.That(itemUnderTest.Path, Is.EqualTo(expectedValue));
		}
	}
}